/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cda.pager;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;


/**
 *
 * @author Votre nom
 */
public class DateNumero {
    GregorianCalendar d;
    int annee = 0;
    int mois = 0;
    int date = 0;
    int jour = 0;

    public DateNumero(){
        d = new GregorianCalendar();
        d.setTime(new Date());
        jour = d.get(d.DAY_OF_WEEK);
        date = d.get(d.DATE);
        mois = d.get(d.MONTH);
        annee = d.get(d.YEAR);
    }

    public DateNumero(int da, int mo, int an){
        d = new GregorianCalendar();
        d.setTime(new Date(an-1900, mo-1, da));
        jour = d.get(d.DAY_OF_WEEK);
        date = d.get(d.DATE);
        mois = d.get(d.MONTH);
        annee = d.get(d.YEAR);
    }
    
    public String getDatePropre(){
        String retour = getJour()+" "+date+" "+getMois()+" "+annee;
        return retour;
    }

    public String getAnnee(){
        return ""+annee;
    }

    private String getJour(){
        String retour = "";

        switch(jour){
            case GregorianCalendar.MONDAY:
                retour = "Lundi";
                break;
            case GregorianCalendar.TUESDAY:
                retour = "Mardi";
                break;
            case GregorianCalendar.WEDNESDAY:
                retour = "Mercredi";
                break;
            case GregorianCalendar.THURSDAY:
                retour = "Jeudi";
                break;
            case GregorianCalendar.FRIDAY:
                retour = "Vendredi";
                break;
            case GregorianCalendar.SATURDAY:
                retour = "Samedi";
                break;
            case GregorianCalendar.SUNDAY:
                retour = "Dimanche";
                break;
        }
        return retour;
    }

    private String getMois(){
        String retour = "";

        switch(mois){
            case GregorianCalendar.JANUARY:
                retour = "Janvier";
                break;
            case GregorianCalendar.FEBRUARY:
                retour = "Fevrier";
                break;
            case GregorianCalendar.MARCH:
                retour = "Mars";
                break;
            case GregorianCalendar.APRIL:
                retour = "Avril";
                break;
            case GregorianCalendar.MAY:
                retour = "Mai";
                break;
            case GregorianCalendar.JUNE:
                retour = "Juin";
                break;
            case GregorianCalendar.JULY:
                retour = "Juillet";
                break;
            case GregorianCalendar.AUGUST:
                retour = "Aout";
                break;
            case GregorianCalendar.SEPTEMBER:
                retour = "Septembre";
                break;
            case GregorianCalendar.OCTOBER:
                retour = "Octobre";
                break;
            case GregorianCalendar.NOVEMBER:
                retour = "Novembre";
                break;
            case GregorianCalendar.DECEMBER:
                retour = "Decembre";
                break;
        }
        return retour;
    }
}
